﻿using System;

namespace Experiment2
{
    public class Delegate1
    {  
        public delegate void MeDelegate();
        public event MeDelegate NotifyEveryOne;
        public void Notify()
        {
            if (NotifyEveryOne != null)
            {
                Console.WriteLine("触发事件");
                NotifyEveryOne();
            }
        }
    }
   public class classA
    {
        public void DisMethod()
        {
            Console.WriteLine("classA 已接到 NotifyEveryOne 通知 ");
        }
    }
    public class classB
    {
        public void DisMethod()
        {
            Console.WriteLine("classB 已接到 NotifyEveryOne 通知 ");
        }
    }
}
